﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ZC.MUSIC.COMMAND;

namespace ZC.MUSIC.ViewModels
{
    class ResourceTestViewModel:BindableBase
    {
        private int _foreground;
        /// <summary>
        /// 用来改变view 中元素前景色的值
        /// </summary>
        public int Foreground
        {
            get { return _foreground;  }
            set
            {
                _foreground = value;
                OnPropertyChanged(propertyName: "Foreground"); //属性的名称一定要写对和属性名称一致！！
            }
        }


        #region 命令属性
        public ICommand ResourceTestCommand { get; set; }
        #endregion

        public ResourceTestViewModel()
        {
            ResourceTestCommand = new ResourceTestCommand(ChangeForegroundAction);
        }

        #region 命令方法
        private void ChangeForegroundAction()
        {
            if (Foreground > 2)
            {
                Foreground = -1;
            }
            Foreground++;
        }
        #endregion


    }
}
